import request from '~/utils/request'

export default {
  // 登录验证
  login(mobile, password) {
    return request({
      // baseURL: 'http://localhost:8160',
      url: `/api/ucenter/member/login`,
      method: 'POST',
      params: { mobile, password }
    })
  },

  // 获取token中数据
  getUserInfo(token) {
    return request({
      // baseURL: 'http://localhost:8160',
      url: `/api/ucenter/member/auth/getUserInfo`,
      method: 'GET',
      headers: { token } // 请求头中参数
    })
  },
  // 发送短信验证码
  sendMsg(mobile) {
    return request({
      // baseURL: 'http://localhost:8106',
      url: `/api/sms/sendMsg/${mobile}`,
      method: 'GET'
    })
  },
  // 注册账号
  register(member) {
    return request({
      // baseURL: 'http://localhost:8160',
      url: `/api/ucenter/member/register`,
      method: 'POST',
      data: member
    })
  }

}

